import './assets/main.css'
import {createApp} from 'vue'
import {createPinia} from 'pinia'

import App from './App.vue'
import router from './router'
import {initVant} from './plugs/index.js'


// 💡 替换 ConfigProvider.set({ ripple: false }) 方案
if (typeof document !== 'undefined') {
    const style = document.createElement('style')
    style.textContent = `    .van-button--default::after,
    .van-button--primary::after,
    .van-button--success::after,
    .van-button--danger::after,
    .van-button--warning::after {
      display: none !important;
    }
  `
    document.head.appendChild(style)
}

const mountFunc = () => {
    // 1. 创建 Vue 应用实例
    const app = createApp(App)
    initVant(app)
    app.use(createPinia())
    app.use(router)
    app.mount('#app')
}
// const app = createApp(App)
//
// app.use(createPinia())
// app.use(router)
//
//
// app.mount('#app')

// 在 Cordova 容器中，等待 deviceready 再初始化 Vue
if (window.cordova) {
    // 在 Cordova 容器中，等待 deviceready 再初始化 Vue
    document.addEventListener('deviceready', () => {
        console.log('Cordova is ready!')
        mountFunc()
    }, false)
} else {
    mountFunc()
}
